﻿@model Website.Models.Painting

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm("Add", "Paintings", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>New Painting</legend>

        <div class="editor-label">
            @Html.LabelFor(m => m.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.Name)
            @Html.ValidationMessageFor(m => m.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.Year)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.Year)
            @Html.ValidationMessageFor(m => m.Year)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.Filename)
         </div>
        <div class="editor-field">
             @Html.TextBoxFor(m => m.Filename, new { type = "file" })
             @Html.ValidationMessageFor(m => m.Filename)
         </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
